package com.zzw.controller;

import com.zzw.dao.TrackDao;
import com.zzw.model.Track;
import com.zzw.model.TrackHeatMapInfo;
import com.zzw.model.TrackInfo;
import com.zzw.model.TrackQuery;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/yunji-api/track")
public class TrackController {
    @Resource
    private TrackDao trackDao;

    @PostMapping("/insert")
    public Integer insert(@RequestBody Track track) {
        //省略校验
        return trackDao.insert(track);
    }

    @PostMapping("/select")
    public List<TrackInfo> select(@RequestBody TrackQuery query) {
        //省略校验
        return trackDao.select(query);
    }

    @PostMapping("/heatmap/select")
    public List<TrackHeatMapInfo> heatMapSelect(@RequestBody TrackQuery query) {
        //省略校验
        return trackDao.selectHeatMap(query);
    }
}
